package cn.crm.controller;

import cn.crm.dao.CstServiceDao;
import cn.crm.pojo.CstCustomer;
import cn.crm.pojo.CstService;
import cn.crm.service.CstLostService;
import cn.crm.service.CstServiceService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/CstService")
public class CstServiceController {
    @Autowired
    private CstServiceService cstServiceService;
    @PostMapping("/Page")
    public Page getPage(Page page){
        LambdaQueryWrapper<CstService> lqw = new LambdaQueryWrapper<>();
        lqw.orderByDesc(CstService::getSvrId);
        return cstServiceService.page(page,lqw);
    }
    @GetMapping("/Count")
    public List<CstService> getCount(){
        return cstServiceService.getCount();
    }
}
